<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Number对象</title>
</head>

<body>
    <script>
        var num = 10
        //o是对象
        var o = new Number(10)
        console.log(o, typeof o, o.valueOf());//Number对象 数据类型"object" 值为10
        // console.log(o.parseInt());

        // 类型转换
        var m = Number('10x')
        console.log(m, typeof m)//NaN "number"

        var x = 5.3135
        // 如果保留2位小数
        console.log(x.toFixed(2))//5.31

        var y = 10800
        // 科学计数法
        console.log(y.toPrecision(3))//1.08e+4
    </script>
</body>

</html>